using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using DomainLayer.Data.Entities;

namespace Infrastructure.Data.Mapping
{
	public class ExpressCompanyMap : EntityTypeConfiguration<ExpressCompany>
	{
		public ExpressCompanyMap()
		{
			// Primary Key
			this.HasKey(t => t.ExpressCompanyID);

			// Properties
			this.Property(t => t.ExpressCompanyID)
				.HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
				
			this.Property(t => t.ExpressCompanyCode)
				.IsRequired()
				.HasMaxLength(50);
				
			this.Property(t => t.CompanyName)
				.HasMaxLength(100);
				
			this.Property(t => t.CompanyAllName)
				.HasMaxLength(100);
				
			this.Property(t => t.SimpleSpell)
				.HasMaxLength(50);
				
			this.Property(t => t.DistrictID)
				.HasMaxLength(10);
				
			this.Property(t => t.ProvinceID)
				.HasMaxLength(10);
				
			this.Property(t => t.CityID)
				.HasMaxLength(10);
				
			this.Property(t => t.MainContacter)
				.HasMaxLength(50);
				
			this.Property(t => t.LevelCode)
				.IsRequired()
				.HasMaxLength(50);
				
			this.Property(t => t.Address)
				.HasMaxLength(50);
				
			this.Property(t => t.Email)
				.HasMaxLength(100);
				
			this.Property(t => t.ContacterPhone)
				.HasMaxLength(50);
				
			// Table & Column Mappings
			this.ToTable("ExpressCompany");
			this.Property(t => t.ExpressCompanyID).HasColumnName("ExpressCompanyID");
			this.Property(t => t.ExpressCompanyOldID).HasColumnName("ExpressCompanyOldID");
			this.Property(t => t.ExpressCompanyCode).HasColumnName("ExpressCompanyCode");
			this.Property(t => t.CompanyName).HasColumnName("CompanyName");
			this.Property(t => t.CompanyAllName).HasColumnName("CompanyAllName");
			this.Property(t => t.SimpleSpell).HasColumnName("SimpleSpell");
			this.Property(t => t.DistrictID).HasColumnName("DistrictID");
			this.Property(t => t.ProvinceID).HasColumnName("ProvinceID");
			this.Property(t => t.CityID).HasColumnName("CityID");
			this.Property(t => t.ParentID).HasColumnName("ParentID");
			this.Property(t => t.CompanyFlag).HasColumnName("CompanyFlag");
			this.Property(t => t.MainContacter).HasColumnName("MainContacter");
			this.Property(t => t.LevelCode).HasColumnName("LevelCode");
			this.Property(t => t.MaxOrderLimit).HasColumnName("MaxOrderLimit");
			this.Property(t => t.IsReplacement).HasColumnName("IsReplacement");
			this.Property(t => t.IsPOS).HasColumnName("IsPOS");
			this.Property(t => t.IsCod).HasColumnName("IsCod");
			this.Property(t => t.IsPDA).HasColumnName("IsPDA");
			this.Property(t => t.Address).HasColumnName("Address");
			this.Property(t => t.Email).HasColumnName("Email");
			this.Property(t => t.ContacterPhone).HasColumnName("ContacterPhone");
			this.Property(t => t.Deposit).HasColumnName("Deposit");
			this.Property(t => t.Sorting).HasColumnName("Sorting");
			this.Property(t => t.IsDeleted).HasColumnName("IsDeleted");
			this.Property(t => t.CreatBy).HasColumnName("CreatBy");
			this.Property(t => t.CreatTime).HasColumnName("CreatTime");
			this.Property(t => t.CreatStationID).HasColumnName("CreatStationID");
			this.Property(t => t.UpdateBy).HasColumnName("UpdateBy");
			this.Property(t => t.UpdateTime).HasColumnName("UpdateTime");
			this.Property(t => t.UpdateStationID).HasColumnName("UpdateStationID");
			this.Property(t => t.IsOpen).HasColumnName("IsOpen");
			this.Property(t => t.ExpressCompanyVjiaOldID).HasColumnName("ExpressCompanyVjiaOldID");
		}
	}
}

